package adv6;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @author oldliu
 * @since 1.0
 */
public class ClsTest4 {
    public static void main(String[] args) {
        //反射处理数组
        //Arrays.sort();
        Object o = Array.newInstance(int.class, 10);
        Array.setInt(o,0,100);
        Array.setInt(o,1,200);
        Array.setInt(o,2,200);
        Array.setInt(o,3,99);

        int []ar= (int[]) o;
        ar[2]=989;
        System.out.println(Arrays.toString(ar));
        System.out.println(Array.get(o, 3));
    }
}
